<?php

namespace BXTR\BookBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Book
 */
class Book
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string Title of the book.
     */
    private $title;

    /**
     * @var \DateTime
     */
    private $publish_date;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    public function __toString()
    {
        return $this->getTitle();
    }

    /**
     * Set title
     *
     * @param string $title
     * @return Book
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get title
     *
     * @return string 
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set publish_date
     *
     * @param \DateTime $publishDate
     * @return Book
     */
    public function setPublishDate($publishDate)
    {
        $this->publish_date = $publishDate;

        return $this;
    }

    /**
     * Get publish_date
     *
     * @return \DateTime 
     */
    public function getPublishDate()
    {
        return $this->publish_date;
    }
    /**
     * @var \BXTR\BookBundle\Entity\BookState
     */
    private $state;


    /**
     * Set state
     *
     * @param \BXTR\BookBundle\Entity\BookState $state
     * @return Book
     */
    public function setState(\BXTR\BookBundle\Entity\BookState $state = null)
    {
        $this->state = $state;

        return $this;
    }

    /**
     * Get state
     *
     * @return \BXTR\BookBundle\Entity\BookState 
     */
    public function getState()
    {
        return $this->state;
    }
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $editions;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->editions = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add editions
     *
     * @param \BXTR\BookBundle\Entity\Edition $editions
     * @return Book
     */
    public function addEdition(\BXTR\BookBundle\Entity\Edition $editions)
    {
        $this->editions[] = $editions;

        return $this;
    }

    /**
     * Remove editions
     *
     * @param \BXTR\BookBundle\Entity\Edition $editions
     */
    public function removeEdition(\BXTR\BookBundle\Entity\Edition $editions)
    {
        $this->editions->removeElement($editions);
    }

    /**
     * Get editions
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getEditions()
    {
        return $this->editions;
    }

    /**
     * Set editions
     *
     * @param \BXTR\BookBundle\Entity\Edition $editions
     * @return Book
     */
    public function setEditions(\BXTR\BookBundle\Entity\Edition $editions = null)
    {
        $this->editions = $editions;

        return $this;
    }
    /**
     * @var \BXTR\BookBundle\Entity\BookCategory
     */
    private $category;


    /**
     * Set category
     *
     * @param \BXTR\BookBundle\Entity\BookCategory $category
     * @return Book
     */
    public function setCategory(\BXTR\BookBundle\Entity\BookCategory $category = null)
    {
        $this->category = $category;

        return $this;
    }

    /**
     * Get category
     *
     * @return \BXTR\BookBundle\Entity\BookCategory 
     */
    public function getCategory()
    {
        return $this->category;
    }
}
